let mongoose = require('mongoose');

let Schema = mongoose.Schema;

let userSchema = new Schema({
    loginId: {
        type: String,
        index: true,
        unique: true,
        minlength: 3,
        maxlength: 18,
        trim: true,
    },
    loginPwd: {
        type: String,
        required: true,
        trim: true,

    },
    phone: {
        type: String,
        trim: true,
    },
    privilege: {
        type: String,
    },
}, {
    versionKey: false
});

module.exports = mongoose.model('userModel', userSchema, 'users');